package com.siysoft.tc.base.bean.to;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;


/**
 * The persistent class for the db_manager database table.
 * 
 */
@Entity
@Table(name="db_manager")
public class Manager implements Serializable,UserDetails {
	private static final long serialVersionUID = 1L;
	private int managerId;
	private String password;
	private String username;
	private boolean accountNonExpired;
	private boolean accountNonLocked;
	private boolean credentialsNonExpired;
	private boolean enabled;
	private Collection<GrantedAuthority> authorities;
	/**
	 * @return the accountNonExpired
	 */
	@Column(name="accountNonExpired")
	public boolean isAccountNonExpired() {
		return accountNonExpired;
	}


	/**
	 * @param accountNonExpired 要设置的 accountNonExpired
	 */
	public void setAccountNonExpired(boolean accountNonExpired) {
		this.accountNonExpired = accountNonExpired;
	}


	/**
	 * @return the accountNonLocked
	 */
	@Column(name="accountNonLocked")
	public boolean isAccountNonLocked() {
		return accountNonLocked;
	}


	/**
	 * @param accountNonLocked 要设置的 accountNonLocked
	 */
	public void setAccountNonLocked(boolean accountNonLocked) {
		this.accountNonLocked = accountNonLocked;
	}


	/**
	 * @return the credentialsNonExpired
	 */
	@Column(name="credentialsNonExpired")
	public boolean isCredentialsNonExpired() {
		return credentialsNonExpired;
	}


	/**
	 * @param credentialsNonExpired 要设置的 credentialsNonExpired
	 */
	public void setCredentialsNonExpired(boolean credentialsNonExpired) {
		this.credentialsNonExpired = credentialsNonExpired;
	}


	/**
	 * @return the enabled
	 */
	@Column(name="enabled")
	public boolean isEnabled() {
		return enabled;
	}


	/**
	 * @param enabled 要设置的 enabled
	 */
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}


	/**
	 * @return the serialversionuid
	 */
	public static long getSerialversionuid() {
		return serialVersionUID;
	}


	/**
	 * @return the authorities
	 */
	@Transient
	public Collection<GrantedAuthority> getAuthorities() {
		return authorities;
	}


	public Manager() {
	}


	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="manager_id")
	public int getManagerId() {
		return this.managerId;
	}

	public void setManagerId(int managerId) {
		this.managerId = managerId;
	}

	@Column(name="password")
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name="username")
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}
	public void setAuthorities(Collection<GrantedAuthority> authorities) {
		this.authorities = authorities;
	}

}